public void sumBindDetail(SettleCusSum settleCusSum, CreateSettleSumDto.Core p){
        CreateSettleSumDto.Core param = BeanCopyUtil.beanCopy(p, CreateSettleSumDto.Core.class);
        param.setCurrency(settleCusSum.getCurrency());
        Boolean adjustDetailStatus = param.getAdjustDetailStatus();
        Integer pageIndex = 1;
        boolean hasMorePages = true;
        String sumCode = settleCusSum.getCode();
        //settleSumCusDetailDao.delete(w->w.setSumCode(settleCusSum.getCode()));
        long  checkStatusNums=0;
        Integer count = 0;
        while (hasMorePages) {
            PageHelper.startPage(pageIndex,600);
            List<Long> ids = cusSettleDetailMapper.findSumDetail(param);
            PageInfo page = new PageInfo(ids);
            if (CollectionUtil.isEmpty(ids)) {
                hasMorePages = false;
                continue;
            }
            CusSettleDetailDTO.UpdateSettle.Input input = new CusSettleDetailDTO.UpdateSettle.Input();
            input.setIds(ids);
            count = count+ids.size();
            List<CreateSettleSumDto.DetailStatus> sumDetailList = cusSettleDetailMapper.findSumDetailList(input);
            long sumcount = sumDetailList.stream().filter(t -> t.getCheckStatus().equals(SettleCusReconcileStatusEnum.HAS_RECONCILE.getCode())).count();
            checkStatusNums=checkStatusNums+sumcount;
//            if (adjustDetailStatus) {
//                settleCusDetailDao.update().set(w->{w.setCheckStatus(SettleCusReconcileStatusEnum.IN_RECONCILE.getCode());}).whereExpr(w -> $(w.getId(), in(), ids)).execute();
//            }
            List<SettleSumCusDetail> list = settleSumCusDetailDao.where(w -> w.setId(in(ids))).toList();
            List<Long> listIds = list.stream().map(x -> x.getId()).collect(Collectors.toList());
            List<Long> del = new ArrayList<>();
            for(SettleSumCusDetail s : list){
                if(!s.getSumCode().equals(sumCode)){
                    del.add(s.getId());
                }
            }
            if(CollectionUtil.isNotEmpty(del)){
                settleSumCusDetailDao.delete(w->w.setId(in(del)));
            }
            Set<Long> add = ids.stream()
                    .filter(item -> !listIds.contains(item))
                    .collect(Collectors.toSet());
            add.addAll(del);
            if(CollectionUtil.isNotEmpty(add)){
                List<SettleSumCusDetail> sums = new ArrayList<>();
                add.forEach(x->{
                    SettleSumCusDetail sum = new SettleSumCusDetail();
                    sum.setId(x);
                    sum.setSumCode(settleCusSum.getCode());
                    sum.setDetailId(x);
                    sums.add(sum);
                });
                settleSumCusDetailMapper.batchInsert(sums);
            }
//            if (CollectionUtil.isEmpty(sumDetailList)) {
//                hasMorePages = false;
//                continue;
//            }
            pageIndex++;
            if (pageIndex > page.getPages()) {
                hasMorePages = false;
            }
        }
        settleCusSum.setOrderNum(count.longValue());
        settleCusSum.setSuccessNum(checkStatusNums);//对账成功数量
        log.info("客户对账单号:{}--》数量：{},对账成功统计:{}",settleCusSum.getCode(),settleCusSum.getOrderNum(),settleCusSum.getSuccessNum());
    }